<?php

namespace App\Admin\Extensions\Table;

use App\Admin\Repositories\ShopUser;
use Dcat\Admin\Grid;
use Dcat\Admin\Grid\LazyRenderable;

class ShopSelectTable extends LazyRenderable
{
    public function grid(): Grid
    {
        return Grid::make(new ShopUser(), function (Grid $grid) {
            $grid->disableCreateButton();
            $grid->disableBatchActions();
            $grid->disableActions();
            $grid->model()->orderByDesc("id");
            $grid->column('id','门店ID')->sortable();
            $grid->column('name','门店名称');
            $grid->column('username','门店账号');
            $grid->column('status')->using(['正常','隐藏'])->label(['info','danger']);
            $grid->column('created_at');
            $grid->quickSearch(['id','name','username','category.name']);
            $grid->paginate(8);
        });
    }


}
